﻿using System;
using System.Collections.Generic;
using System.Text;
using WordService.Model;

namespace WordService.Data.IDAL
{
    /// <summary>
    /// 作者的数据层接口
    /// </summary>
    public interface IAuthorDAL
    {
        /// <summary>
        /// 插入作者的数据层接口
        /// </summary>
        /// <param name="name">作者姓名</param>
        /// <param name="sequence">作者顺序</param>
        /// <param name="articleID">对应文章ID</param>
        /// <param name="rightRate">作者的权值</param>
        /// <param name="totalCount">作者总共出现的次数</param>
        /// <returns>返回插入的作者的ID号</returns>
        Int64 InsertAuthor(String name,Int32 sequence,Int64 articleID,decimal rightRate,Int64 totalCount);
        /// <summary>
        /// 保存作者的数据层接口【添加、更新】
        /// </summary>
        /// <param name="name">作者姓名</param>
        /// <param name="sequence">作者顺序</param>
        /// <param name="articleID">对应文章ID</param>
        /// <param name="rightRate">作者的权值</param>
        /// <param name="totalCount">作者总共出现的次数</param>
        /// <returns>返回保存的作者ID号</returns>
        Int64 SaveAuthor(String name, Int32 sequence, Int64 articleID, decimal rightRate, Int64 totalCount);
        /// <summary>
        /// 更新作者的数据层接口
        /// </summary>
        /// <param name="name">作者姓名</param>
        /// <param name="sequence">作者顺序</param>
        /// <param name="articleID">对应文章ID</param>
        /// <param name="rightRate">作者的权值</param>
        /// <param name="totalCount">作者总共出现的次数</param>
        /// <param name="ID">作者的ID号</param>
        /// <returns>返回保存的作者的ID号</returns>
        Int64 UpdateAuthor(String name, Int32 sequence, Int64 articleID, decimal rightRate, Int64 totalCount,Int64 ID);
        /// <summary>
        /// 添加作者和机构的关联关系
        /// </summary>
        /// <param name="authorID"></param>
        /// <param name="institutionID"></param>
        /// <returns></returns>
        Boolean InsertRelationAI(Int64 authorID, Int64 institutionID);
        /// <summary>
        /// 查询作者列表需要的内容
        /// </summary>
        /// <param name="keywordName">关键字名</param>
        /// <param name="insName">机构名</param>
        /// <param name="frequency">频次录入</param>
        /// <param name="year">输入年份</param>
        /// <returns></returns>
        IList<Author> QueryByCondition(String keywordName, String insName, Int64 frequency, String year);
    }
}
